"""
FlowScape 后端配置文件
"""
import os
from typing import List
from dotenv import load_dotenv

# 加载环境变量
load_dotenv()


class Settings:
    """应用配置"""

    # 服务器配置
    HOST: str = os.getenv("HOST", "0.0.0.0")
    PORT: int = int(os.getenv("PORT", "8000"))
    DEBUG: bool = os.getenv("DEBUG", "True").lower() == "true"

    # CORS配置
    ALLOWED_ORIGINS: List[str] = os.getenv(
        "ALLOWED_ORIGINS", "http://localhost:5173"
    ).split(",")

    # API配置
    API_PREFIX: str = "/api"
    API_VERSION: str = "v1.0.0"
    PROJECT_NAME: str = "FlowScape Backend"
    PROJECT_DESCRIPTION: str = "北京鸟巢体育馆人员分类可视化系统后端API"

    # 日志配置
    LOG_LEVEL: str = os.getenv("LOG_LEVEL", "INFO")

    # 缓存配置
    CACHE_ENABLED: bool = os.getenv("CACHE_ENABLED", "False").lower() == "true"
    CACHE_TTL: int = int(os.getenv("CACHE_TTL", "300"))

    # 数据配置
    DATA_REFRESH_INTERVAL: int = int(os.getenv("DATA_REFRESH_INTERVAL", "30"))

    # 模型配置
    MODEL_DIR: str = "models"
    USE_MOCK_DATA: bool = True  # 开发阶段使用模拟数据


settings = Settings()
